<%@ include file="connect.jsp" %>

<%


    String answer = request.getParameter("answer");
    String que = request.getParameter("quewrite");
    String detailtestID = request.getParameter("detailtestID");
    String idTest = request.getParameter("idTest");
    String img = request.getParameter("picture");
    String target = request.getParameter("option");
    String ganti = que.replaceAll("'", "''");

    stat.executeUpdate("INSERT INTO DetailQuestion (Answer,Images,detailTestID,Question,target,StylesID) values ('" + answer + "',lower('" + img + "'),'" + detailtestID + "','" + ganti + "','"+target+"',3)");
    if (idTest.equals("1")) {
        response.sendRedirect("pretest.jsp?respon=Successfully added question!");


    } else {
        response.sendRedirect("posttest.jsp?respon=Successfully added question!");

    }


    conn.close();


%>